<?php

namespace app\common\library\notice;

use app\common\library\ReturnResult;

/**
 * 消息通知
 *
 * @author LCY <409028735@qq.com>
 */
class Notice
{
    use ReturnResult;

    /**
     * 发送消息通知的入口文件
     *
     * @param string $channel
     * @param array $params
     * @return void
     */
    public static function send($channel = 'sms', $params = [])
    {
        switch ($channel) {
            case 'sms':
                $scene = $params['scene'];
                $mobile = $params['mobile'];
                $template_params = $params['template_params'];
                $res = Sms::send($scene, $mobile, $template_params);
                if(true !== $res){
                    return self::error($res);
                }
                break;
            case 'wechat_subscribe':
                
                break;
            case 'wechat_template':
                break;
        }

        return self::success();
    }
}
